Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
array.prototype.some
Advanced tools
An ES5 spec-compliant `Array.prototype.some` shim/polyfill/replacement that works as far down as ES3.
An ES5 spec-compliant Array.prototype.some
shim/polyfill/replacement that works as far down as ES3.
This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the proposed spec.
Because Array.prototype.some
depends on a receiver (the “this” value), the main export takes the array to operate on as the first argument.
var some = require('array.prototype.some');
var assert = require('assert');
assert.equal(true, some([1, 2, 3], function (x) { return x === 2; }));
assert.equal(false, some([1, 2, 3], function (x) { return x === 4; }));
var some = require('array.prototype.some');
var assert = require('assert');
/* when Array#some is not present */
delete Array.prototype.some;
var shimmedSome = some.shim();
assert.equal(shimmedSome, some.getPolyfill());
var arr = [1, 2, 3];
var threeOrLarger = function (x) { return x >= 3; };
assert.deepEqual(arr.some(threeOrLarger), some(arr, threeOrLarger));
var some = require('array.prototype.some');
var assert = require('assert');
/* when Array#some is present */
var shimmedSome = some.shim();
assert.equal(shimmedSome, Array.prototype.some);
assert.deepEqual(arr.some(threeOrLarger), some(arr, threeOrLarger));
Simply clone the repo, npm install
, and run npm test
FAQs
An ES5 spec-compliant `Array.prototype.some` shim/polyfill/replacement that works as far down as ES3.
The npm package array.prototype.some receives a total of 13,255 weekly downloads. As such, array.prototype.some popularity was classified as popular.
We found that array.prototype.some demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.